﻿using SqlSugar;
using System;

namespace IconYuan.Model.Entity.Markets
{
    /// <summary>
    /// 用户优惠券记录
    /// </summary>
    [SugarTable("t_coupon_user")]
    public class UserCoupon
    {
        /// <summary>
        /// 自增
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        public int user_coupon_id { get; set; }
        /// <summary>
        /// 用户id
        /// </summary>
        public int user_id { get; set; }
        /// <summary>
        /// 优惠券ID
        /// </summary>
        public int coupon_id { get; set; }
        /// <summary>
        /// 优惠券名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 优惠券类型(10满减券 20折扣券)
        /// </summary>
        public int coupon_type { get; set; }
        /// <summary>
        /// 满减券，满多少
        /// </summary>
        public decimal min_price { get; set; }
        /// <summary>
        /// 减多少
        /// </summary>
        public decimal reduce_price { get; set; }
        /// <summary>
        /// 折扣券-折扣率(0-100)
        /// </summary>
        public int discount { get; set; }
        /// <summary>
        /// 到期类型(10领取后生效 20固定时间)
        /// </summary>
        public int expire_type { get; set; }
        /// <summary>
        /// 领取后生效-有效天数
        /// </summary>
        public int expire_day { get; set; }
        /// <summary>
        /// 有效期开始时间
        /// </summary>
        public DateTime start_time { get; set; }
        /// <summary>
        /// 有效期结束时间
        /// </summary>
        public DateTime end_time { get; set; }
        /// <summary>
        /// 适用范围(10全部商品 20指定商品)
        /// </summary>
        public int range { get; set; }
        /// <summary>
        /// 适用范围配置(json格式)
        /// </summary>
        public string range_config { get; set; } = string.Empty;
        /// <summary>
        /// 是否过期(0未过期 1已过期)
        /// </summary>
        public int is_expire { get; set; } = 0;
        /// <summary>
        /// 是否已使用(0未使用 1已使用)
        /// </summary>
        public int is_use { get; set; } = 0;
        /// <summary>
        /// 商城ID
        /// </summary>
        public int store_id { get; set; }
        public DateTime create_time { get; set; }
        public DateTime update_time { get; set; }
    }
}